package client.behavioral.command;

import org.junit.Test;
import org.xml.sax.SAXException;
import uml.behavioral.command.Command;
import uml.behavioral.command.CommandInvoker;
import util.bean.BeanUtil;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;

/**
 * 命令--客户端<br>
 * 基于抽象命令和命令发送者编程
 * on 2023/1/2 20:46
 */
public class Client {
    @Test
    public void t() throws ParserConfigurationException, IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, SAXException {
        Command command = BeanUtil.newBean(Command.class,
                new File("src/main/resources/xml/command.xml"),
                "commandName");
        CommandInvoker ci = new CommandInvoker();
        ci.setCommand(command);
        ci.invoke();
    }
}
